<?php
if(isset($_POST["username"]) && isset($_POST["pass"])){
	$username = $_POST["username"];
	$pass = $_POST["pass"];
	$_SESSION["username"] = $username;
	$_SESSION["pass"] = $pass;	
}
try {
	require_once "templates/authenticate.php";
	
	echo "<p class='userInfo'>
	Bienvenido $username!<br />
	<a href='javascript:redirect(\"./welcome.php\", \"contenidos\", \"\", \"POST\");'>Logout</a>
	</p><br />";
	echo "<input type=button onclick='javascript:redirect(\"postLoginMenu.php\", \"menu\", \"\", \"POST\")' value='Recargar menú lateral'/>";
	
} catch (Exception $e){
	echo "Login fallido, inténtelo nuevamente.";
}